# 元祖的特性：不能被修改，等于Java中的常量
num_list = (1, 2, 3, 3)
print(num_list[0])

# 字典是成对键值对的集合
dir = {'name': '张三', 'age': 18, 'sex': '男'}
print(dir['name'])
print(dir.keys())

# 集合
sets = {1, 2, 3, 3, 4, 5}
for i in sets:
    print(i)

ss = set("sdfsdf")
add = ss.add("2234")
ss.update()
print(ss)

print(id(ss))
i = 73


def test(f1, f2):
    return f1 + f2


total = test(1, 2)
print(total)


def fun(a=2, b=3):
    print(a)
    print(b)


fun()


def func(**keys):
    print(keys)


func(name='张三', age=18)


def funa(a, b=20, *key, d=55):
    print(f"a={a}")
    print(f"b={b}")
    print(f"key={key}")
    print(f"d={d}")


funa(1, 2, (3, 4, 5, 6, 7, 8, 9, 10, 11, 12,), 13, 14, 15, 16, 17, 18, 19)


def t1():
    nonlocal a
    print(a)
    a = 2


t1()
print(a)
